<?php


use Sc\Util\HtmlStructure\Form;
use Sc\Util\HtmlStructure\Html\Html;

Html::create('表单-选项型');

$form = Form::create("demo13Form")->config(['label-width' => '80px']);

$form->addFormItems(
    Form\FormItem::radio('sex', '性别')->options([
        '1' => '男',
        '2' => '女'
    ]),
    Form\FormItem::checkbox('hobby', '爱好')->options([
        '1' => '吃饭',
        '2' => '睡觉',
        '3' => '打豆豆'
    ]),
    Form\FormItem::select('city', '城市')->options([
        '1' => '北京',
        '2' => '上海',
        '3' => '广州'
    ])->col(12, 12),
    Form\FormItem::select('citys', '城市')->multiple()->options([
        '1' => '北京',
        '2' => '上海',
        '3' => '广州'
    ])->col(12, ),
    Form\FormItem::customize("这个是多选")->col(12),
    Form\FormItem::cascader('city2', '城市')->col(12)
        ->options([
            [
                'value' => '1',
                'label' => '北京',
                'children' => [
                    [
                        'value' => '1-1',
                        'label' => '东城'
                    ],
                    [
                        'value' => '1-2',
                        'label' => '西城'
                    ]
                ]
            ],
            [
                'value' => '2',
                'label' => '上海'
            ],
            [
                'value' => '3',
                'label' => '广州'
            ]
        ]),
    Form\FormItem::customize("这个是级联")->col(12),
    Form\FormItem::icon('icon', '图标')
);


return $form->render();
